package com.wanbatv.wangwangba.activity;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.app.Activity;
import android.os.Handler;
import android.widget.ImageView;
import android.widget.Toast;

import com.squareup.picasso.Picasso;
import com.wanbatv.wangwangba.R;
import com.wanbatv.wangwangba.model.MainModel;
import com.wanbatv.wangwangba.model.entity.DogtvData;
import com.wanbatv.wangwangba.model.entity.EncyclopediasData;
import com.wanbatv.wangwangba.model.entity.HomepageData;
import com.wanbatv.wangwangba.model.entity.PayData;
import com.wanbatv.wangwangba.model.entity.TrailerData;
import com.wanbatv.wangwangba.model.entity.WechatData;
import com.wanbatv.wangwangba.presenter.MainPresenter;
import com.wanbatv.wangwangba.util.Product;
import com.wanbatv.wangwangba.util.UpdataDownload;
import com.wanbatv.wangwangba.util.Util;
import com.wanbatv.wangwangba.view.MainView;

import java.util.List;

public class MainActivity extends Activity implements MainView{
    private MainPresenter mainPresenter;
    private ImageView imageView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        imageView=(ImageView)findViewById(R.id.imageview);
        mainPresenter=new MainPresenter(this);
        mainPresenter.loadHomepageData();
        UpdataDownload updataDownload=new UpdataDownload(this);
        updataDownload.updataApk(Product.versionName);
        /**
         * 图片加载
         * Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);
         */


    }

    /**
     * 获取context对象
     * @return
     */
    @Override
    public Context getContextFromAct() {
        return this;
    }
    /**
     * 获取首页数据
     * @return
     */
    @Override
    public void showHomepageData(List<HomepageData.DataBean.ListBean> list) {

    }
    /**
     * 获取微信
     * @return
     */
    @Override
    public void showWechatData(List<WechatData.MediaListBean> mediaListBean, List<WechatData.UserListBean> userListBean, String qrUrl) {

    }
    /**
     * 获取dogtv数据
     * @return
     */
    @Override
    public void showDogtvData(List<DogtvData.DataBean.ListBean> listBeen) {

    }
    /**
     * 获取小百科数据
     * @return
     */
    @Override
    public void showEncyclopediasData(List<EncyclopediasData.DataBean.ListBean> listBeen) {

    }
    /**
     * 获取汪汪秀数据
     * @return
     */
    @Override
    public void showWangwangshowData() {

    }
    /**
     * 获取跳转到dogtv
     * @return
     */
    @Override
    public void toDogtvActivity(int i) {
        Intent it=new Intent();
        it.setClass(this,DogtvActivity.class);
        it.putExtra("channelnum",i);
        startActivity(it);
    }
    /**
     * 获取跳转到小百科
     * @return
     */
    @Override
    public void toEncyclopediasActivity(String token) {
        Intent it=new Intent();
        it.setClass(this,DogtvActivity.class);
        it.putExtra("token",token);
        startActivity(it);
    }
    /**
     * 获取跳转到汪汪秀播放
     * @return
     */
    @Override
    public void toWangwangshowPlayActivity(String token, String content_name) {
        Intent it=new Intent();
        it.setClass(this,DogtvActivity.class);
        it.putExtra("token",token);
        it.putExtra("contentname",content_name);
        startActivity(it);
    }
    /**
     * 获取视频预览框数据
     * @return
     */
    @Override
    public void showTrailerData(List<TrailerData.DataBean.LoopPlaylistBean> loopPlaylistBeen) {

    }
    /**
     * 鉴权
     * @return
     */
    @Override
    public void getAuthentication(boolean payCompleted) {

    }
    /**
     * 获取支付数据
     * @return
     */
    @Override
    public void getPayData(List<PayData.DataBean.ListBean> listBeen, int monthoryear) {

    }

    @Override
    public void getOrderData(String subject, String subjectId, String price, String order) {

    }



}
